
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef void (^voiceRecorderDidFinishRecordingBlock)(NSString *filePath, NSString *fileName);
typedef void (^voicePlayerDidFinishPlayingBlock)(BOOL res);

typedef void(^VoiceReocrderResult)(bool res, NSString *msg);
@protocol VoiceReocrderToolDelegate <NSObject>

- (void)recorderVoicePower:(CGFloat)value;

@end
@interface APVoiceReocrderManager : NSObject
@property (nonatomic, copy) NSString *recordVoicePath;
@property (nonatomic, strong) NSData *voiceData;
@property (nonatomic, weak) id<VoiceReocrderToolDelegate>delegate;
@property (nonatomic, copy) voiceRecorderDidFinishRecordingBlock completationBlock;
@property (nonatomic, copy) voicePlayerDidFinishPlayingBlock playingBlock;

+ (instancetype)shareVoiceReocrder;
- (void)startRecord:(VoiceReocrderResult)callBack;
- (void)stopRecord;
- (void)deleCurrentRecordFile;
- (void)startPlay;
- (void)stopPlay;
- (void)voiceRecorderDidFinishRecording:(voiceRecorderDidFinishRecordingBlock)completationBlock;
- (void)voicePlayerDidFinishPlayingBlock:(voicePlayerDidFinishPlayingBlock)playingBlock;
- (NSString *)getCurrentFilePath;
- (NSString *)getCurrentFileName;
- (void)playWithFile:(NSString *)filePath finish:(voicePlayerDidFinishPlayingBlock)callBack;

@end
